GtkStyleSet: Prevent from possible underflow.
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 25 Oct 2010 22:16:22 +0000 (00:16 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 4 Dec 2010 14:38:28 +0000 (15:38 +0100)
gtk/gtkstyleset.c

index 94a4136629f088f61903016bc45b41c6983f1d0f..6009329bc5ccf18292230a655e332cd10ca02e19 100644 (file)
@@ -309,7 +309,12 @@ compare_property (gconstpointer p1,
   PropertyNode *key = (PropertyNode *) p1;
   PropertyNode *node = (PropertyNode *) p2;
 
-  return (int) key->property_quark - node->property_quark;
+  if (key->property_quark > node->property_quark)
+    return 1;
+  else if (key->property_quark < node->property_quark)
+    return -1;
+
+  return 0;
 }
 
 static PropertyNode *